package com.johann.util;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;
//设置生成整形随机数的类
public class RandomSeed {
    public static  Integer [] randomSeed(){
        Random ran = new Random();
        Set<Integer> set = new HashSet<>();
        while (set.size() != 10){
            Integer num = ran.nextInt(100)+1;
            set.add(num);
        }
        Integer [] a=new Integer[set.size()];
        Iterator<Integer> it= set.iterator();
        for (int i = 0; it.hasNext(); i++) {
            a[i]=it.next();
        }
        return a;
    }
}
